#ifndef t_config_h
#define t_config_h

#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <stdio.h>
#include <limits.h>
#include <assert.h>
#if defined(WIN32)
    #if defined(_WIN32_WINNT)
    	#undef _WIN32_WINNT
        #define _WIN32_WINNT 0x0600
    #else
		#define _WIN32_WINNT 0x0600
    #endif /* defined(_WIN32_WINNT) */
    
    #include <winsock2.h>
    #include <mswsock.h>
    #define WIN32_LEAN_AND_MEAN
    #include <windows.h>
    #include <process.h>
     #if defined(_MSC_VER )
        #pragma comment(lib,"wsock32.lib")
    #endif /* defined(_MSC_VER) */
    typedef uintptr_t thread_id_t;
    typedef volatile LONG t_atomic;
#else
     #include <stdint.h>
    #include <errno.h>
    #include <netdb.h>
    #include <sys/types.h>
    #include <sys/time.h>
    #include <netinet/in.h>
    #include <sys/socket.h>
    #include <arpa/inet.h>
    #include <fcntl.h>
    #include <unistd.h>
    #include <pthread.h>
     #define t_atomic volatile int
     #define thread_id_t pthread_t
#endif
#define MALLOC(size) (void*)malloc(size);
#define RELLOC(ptr,size) (void*)realloc(ptr,size);
#define FREE(ptr) do{ if(ptr) free(ptr);} while(0);
#endif